import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

export default new Vuex.Store({
  state: {
    token: null, // 登录token
    admin_name:null
  },
  mutations: {
    loginToken(state){
      let a = document.cookie.split("admin_token=")[1];
      a = a.split(";")[0];
      state.token = a;
    },
    loginName(state){
      let a = document.cookie.split("admin_name=")[1];
      a = a.split(";")[0];
      state.admin_name = a;
    }
  },
  actions: {
  },
  modules: {
  }
})
